<template>
  <div id="demo">
    <transition>
      <button v-bind:key="docState">
        {{ buttonMessage }}
      </button>
    </transition>
  </div>
</template>

<script>
import "animate.css";
export default {
  name: "Hello5",
  data() {
    return {
      docState: "saved",
    
    };
  },
  computed: {
    buttonMessage: function () {
      switch (this.docState) {
        case "saved":
          return "Edit";
        case "edited":
          return "Save";
        case "editing":
          return "Cancel";
      }
    },
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
#demo {
  padding: 30px;
}
/*

      name="animate__animated animate__bounce"
      固定写法
 */
</style>
